extends Area2D


func _process(delta):
	if Input.get_action_strength("向上"):
		if position.y > 0:
			position = position + Vector2(0,-10)  
	if Input.get_action_strength("向下"):
		if position.y < 528:
			position = position + Vector2(0,10)  

func _physics_process(delta):
	for i in get_overlapping_areas():
		if i.is_in_group("ball"):
			i.get_node("bump").play()
			if Input.get_action_strength("向上"):
				i.speed = Vector2(-5,-5)
			elif Input.get_action_strength("向下"):
				i.speed = Vector2(-5,5)
			else :
				i.speed = Vector2(-15,0)
				
	
